import { Rule, RuleType } from '@midwayjs/validate';
import { PageDTO } from '@dto/common/page.dto';

// 查询参数
export class ListRegionDTO extends PageDTO {
  @Rule(RuleType.string())
  regionName?: string;

  @Rule(RuleType.string())
  regionCode?: string;

  @Rule(RuleType.string())
  status?: string;
}

// 新增
export class CreateRegionDTO {
  @Rule(RuleType.string().required())
  regionName: string;

  @Rule(RuleType.string().required())
  regionCode: string;

  @Rule(RuleType.number().min(0))
  parentId?: number;

  @Rule(RuleType.number().required().min(0))
  orderNum: number;

  @Rule(RuleType.string())
  status?: string;

  @Rule(RuleType.string().allow('', null))
  remark?: string;
}

// 修改
export class UpdateRegionDTO extends CreateRegionDTO {
  @Rule(RuleType.number().required())
  regionId: number;
}









